package cn.webestar.scms.task.api.dto.Task;

import cn.webestar.scms.commons.api.UpdateBody;
import cn.webestar.scms.task.entity.Task;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.Date;

@Data
@Schema(description = "TaskUpdateDTO")
public class TaskUpdateDTO extends UpdateBody {

    private String id;

    @Schema(description = "租户")
    private Long cid;

    @Schema(description = "标题")
    private String title;

    @Schema(description = "创建人")
    private Long creator;

    @Schema(description = "更新人")
    private Long updater;

    @Schema(description = "创建时间")
    private Date createTime;

    @Schema(description = "更新时间")
    private Date updateTime;

    @Override
    public String getId() {
        return id;
    }

    @Override
    public Task toDO() {
        Task o = new Task();
        o.setId(id);
        o.setCid(cid);
        o.setTitle(title);
        o.setCreator(creator);
        o.setUpdater(updater);
        o.setCreateTime(createTime);
        o.setUpdateTime(updateTime);
        return o;
    }

}
